#!/usr/bin/env python
PACKAGE = "tracking_pid"

from dynamic_reconfigure.parameter_generator_catkin import *

gen = ParameterGenerator()

gen.add("l", double_t, 0, "Distance between axle and control point", 0.5, -10, 10)
gen.add("Kp_long", double_t, 0, "Kp Longitudinal", 1, 0, 5)
gen.add("Ki_long", double_t, 0, "Ki Longitudinal", 0, 0, 2)
gen.add("Kd_long", double_t, 0, "Kd Longitudinal", 0, 0, 5)

gen.add("Kp_lat", double_t, 0, "Kp Lateral", 1, 0, 10)
gen.add("Ki_lat", double_t, 0, "Ki Lateral", 0, 0, 2)
gen.add("Kd_lat", double_t, 0, "Kd Lateral", 0.3, 0, 10)

gen.add("Kp_ang", double_t, 0, "Kp Angular", 1, 0, 10)
gen.add("Ki_ang", double_t, 0, "Ki Angular", 0, 0, 2)
gen.add("Kd_ang", double_t, 0, "Kd Angular", 0.3, 0, 10)

gen.add("feedback_long",   bool_t,   0, "Enable longitudinal feedback?",  True)
gen.add("feedback_lat",   bool_t,   0, "Enable lateral feedback?",  True)
gen.add("feedback_ang",   bool_t,   0, "Enable angular feedback?",  True)
gen.add("feedforward_long",   bool_t,   0, "Enable longitudinal feedforward?",  True)
gen.add("feedforward_lat",   bool_t,   0, "Enable lateral feedforward?",  True)
gen.add("feedforward_ang",   bool_t,   0, "Enable angular feedforward?",  False)

gen.add("max_yaw_error_cal", double_t, 0, "Max yaw error for coupling between angular and longitudinal controllers", 0.25, 0, 3.1416)
gen.add("dead_zone_yaw_error_cal", double_t, 0, "Dead zone in yaw error for coupling between angular and longitudinal controllers", 0.06, 0, 3.1416)
gen.add("coupling_ang_long",   bool_t,   0, "Enable coupling between angular and longitudinal controllers?",  False)

gen.add("controller_debug_enabled",   bool_t,   0, "Debug controller intermediate gains",  False)

gen.add("controller_timeout",   double_t,   0, "Timeout on setpoint input signal",  0.2, 0, 10)

exit(gen.generate(PACKAGE, "tracking_pid", "Pid"))
